<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->


<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<!--
  This file is a part of the open-eBackup project.
  This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
  If a copy of the MPL was not distributed with this file, You can obtain one at
  http://mozilla.org/MPL/2.0/.
  
  Copyright (c) [2024] Huawei Technologies Co.,Ltd.
  
  THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
  EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
  MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
  -->

<!DOCTYPE html
  PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="zh-cn" xml:lang="zh-cn">
<head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
   
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="DC.Type" content="topic">
<meta name="DC.Title" content="即时恢复Oracle数据库">
<meta name="product" content="">
<meta name="DC.Relation" scheme="URI" content="zh-cn_topic_0000001792389316.html">
<meta name="prodname" content="">
<meta name="version" content="">
<meta name="brand" content="30-OceanProtect 备份一体机 1.5.0-1.6.0 帮助中心">
<meta name="DC.Publisher" content="20240320">
<meta name="DC.Format" content="XHTML">
<meta name="DC.Identifier" content="ZH-CN_TOPIC_0000001792389268">
<meta name="DC.Language" content="zh-cn">
<link rel="stylesheet" type="text/css" href="public_sys-resources/commonltr.css">
<title>即时恢复Oracle数据库</title>
</head>
<body style="clear:both; padding-left:10px; padding-top:5px; padding-right:5px; padding-bottom:5px"><a name="ZH-CN_TOPIC_0000001792389268"></a><a name="ZH-CN_TOPIC_0000001792389268"></a>

<h1 class="topictitle1">即时恢复Oracle数据库</h1>
<div><p>当需要对已备份的数据库进行即时恢复时，可以参考本节即时恢复数据库至原位置或新位置。</p>
<div class="section"><h4 class="sectiontitle">背景信息</h4><ul><li>即时恢复Oracle数据库支持：指定副本即时恢复、指定时间点即时恢复、指定SCN即时恢复。</li><li>支持使用备份副本、复制副本、即时挂载产生的副本进行即时恢复。支持恢复至原位置（复制副本不支持恢复至原位置）或新位置。<ul><li>即时恢复至原位置<p>即时恢复至原位置是指恢复至数据库的原主机及原目录，恢复时会覆盖原数据库。</p>
</li><li>即时恢复至新位置<p>即时恢复至新位置时，系统在指定位置恢复新的数据库，如果存在同名数据库，则会覆盖同名数据库。</p>
</li></ul>
</li><li>即时恢复时，如果目标位置存在同名数据库，建议恢复任务执行过程中不要中止任务，否则会导致原同名数据库损坏。</li></ul>
</div>
<div class="section"><h4 class="sectiontitle">前提条件</h4><ul><li>恢复至的目标主机已安装ProtectAgent及其他相关软件。<p>具体操作可参考<span>《OceanProtect <span id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001792502994_ph19170214112011">备份一体机 1.5.0-1.6.0</span> ProtectAgent安装指南》</span>。</p>
</li><li>原机恢复且主机已配置了OMF（Oracle Managed Files）时，请确保主机的磁盘剩余空间大小要大于数据库的大小。</li><li>异机恢复至目标主机时，请确保目标主机的磁盘剩余空间大小要大于数据库的大小。</li></ul>
</div>
<div class="section"><h4 class="sectiontitle">操作步骤</h4><ol><li id="ZH-CN_TOPIC_0000001792389268__li189532553114"><a name="ZH-CN_TOPIC_0000001792389268__li189532553114"></a><a name="li189532553114"></a><span>恢复时，如果目标位置存在同名数据库，请先关闭该同名数据库再恢复，否则会导致恢复失败。关闭数据库操作如下：</span><p><div class="note"><img src="public_sys-resources/note_3.0-zh-cn.png"><span class="notetitle"> </span><div class="notebody"><p>当目标位置存在同名数据库时，恢复后同名数据库将被覆盖。</p>
</div></div>
<ol type="a" id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001656561309_ol49608407"><li id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001656561309_li14647185922920">登录Oracle数据库主机。<p id="ZH-CN_TOPIC_0000001792389268__p8360011829"><a name="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001656561309_li14647185922920"></a><a name="zh-cn_topic_0000001656561309_li14647185922920"></a>请使用PuTTY登录Oracle数据库主机，并执行<strong id="ZH-CN_TOPIC_0000001792389268__b14760136722">su - oracle</strong>命令，切换到<strong id="ZH-CN_TOPIC_0000001792389268__b776016920">oracle</strong>账户。</p>
</li><li id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001656561309_li14572194814339">执行以下命令，登录Oracle数据库实例。<ul id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001656561309_zh-cn_topic_0000001656760969_ul7420345341"><li id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001656561309_zh-cn_topic_0000001656760969_li15682124913711">OS认证：<p id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001656561309_zh-cn_topic_0000001656760969_p95148598366"><a name="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001656561309_zh-cn_topic_0000001656760969_li15682124913711"></a><a name="zh-cn_topic_0000001656561309_zh-cn_topic_0000001656760969_li15682124913711"></a><strong id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001656561309_zh-cn_topic_0000001656760969_b14236563719">export ORACLE_SID=</strong><em id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001656561309_zh-cn_topic_0000001656760969_i85144598369">数据库实例名称</em></p>
<p id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001656561309_zh-cn_topic_0000001656760969_p145141259153613"><strong id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001656561309_zh-cn_topic_0000001656760969_b1597618293715">sqlplus / as sysdba</strong></p>
</li><li id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001656561309_zh-cn_topic_0000001656760969_li105571236103417">数据库认证：<p id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001656561309_zh-cn_topic_0000001656760969_p920984963717"><a name="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001656561309_zh-cn_topic_0000001656760969_li105571236103417"></a><a name="zh-cn_topic_0000001656561309_zh-cn_topic_0000001656760969_li105571236103417"></a><strong id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001656561309_zh-cn_topic_0000001656760969_b19174355163720">export ORACLE_SID=</strong><em id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001656561309_zh-cn_topic_0000001656760969_i1420924973715">数据库实例名称</em></p>
<p id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001656561309_zh-cn_topic_0000001656760969_p182093496371"><strong id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001656561309_zh-cn_topic_0000001656760969_b034785743716">sqlplus</strong></p>
<p id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001656561309_zh-cn_topic_0000001656760969_p17915722412">根据提示输入具备<strong id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001656561309_zh-cn_topic_0000001656760969_b1691518214115">sysdba</strong>权限的用户：</p>
<pre class="screen" id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001656561309_zh-cn_topic_0000001656760969_screen9915112104114"><em id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001656561309_zh-cn_topic_0000001656760969_i1915102164113">username </em>as sysdba</pre>
<p id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001656561309_zh-cn_topic_0000001656760969_p159150224117">根据提示输入密码。</p>
</li></ul>
</li><li id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001656561309_li198251911109">执行以下命令关闭同名数据库。<p id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001656561309_p96841918142516"><a name="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001656561309_li198251911109"></a><a name="zh-cn_topic_0000001656561309_li198251911109"></a><strong id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001656561309_b1025322122520">shutdown immediate;</strong></p>
</li></ol>
</p></li><li id="ZH-CN_TOPIC_0000001792389268__li17844445165619"><a name="ZH-CN_TOPIC_0000001792389268__li17844445165619"></a><a name="li17844445165619"></a><span>恢复至原位置时，要求目标主机的空闲内存大小必须大于数据库的SGA和PGA的大小总和，否则可能导致恢复失败。</span><p><div class="p">检查内存、SGA、PGA大小的操作如下：<ol type="a"><li>查看SGA和PGA大小。<ol class="substepthirdol"><li>登录Oracle数据库。<p>具体操作可参考<a href="#ZH-CN_TOPIC_0000001792389268__li189532553114">1</a>。</p>
</li><li>执行以下命令查看SGA的大小。<p id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001839188281_p1865918316502"><strong id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001839188281_b1265903185017">show parameter sga;</strong></p>
<div class="p" id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001839188281_p196591232506">回显类似如下，查看<span class="uicontrol" id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001839188281_uicontrol365911365013">“sga_target”</span>的值。<pre class="screen" id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001839188281_screen965973135010">SQL&gt; show parameter sga;

NAME                                 TYPE                              VALUE
------------------------------------ --------------------------------- ------------------------------
allow_group_access_to_sga            boolean                            FALSE
lock_sga                             boolean                            FALSE
pre_page_sga                         boolean                            TRUE
sga_max_size                         big integer                        4768M
sga_min_size                         big integer                        0
<strong id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001839188281_b365911314501">sga_target                       big integer                    4768M</strong>
unified_audit_sga_queue_size         integer                            1048576</pre>
</div>
</li><li>执行以下命令查看PGA的大小。<p id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001839188281_p0659163145014"><strong id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001839188281_b146599335016">show parameter pga;</strong></p>
<p id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001839188281_p176591235501">回显类似如下，查看<span class="uicontrol" id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001839188281_uicontrol66597315507">“pga_aggregate_target”</span>的值。</p>
<pre class="screen" id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001839188281_screen865911317505">SQL&gt; show parameter pga;

NAME                                 TYPE                              VALUE
------------------------------------ -------------------------------- ------------------------------
pga_aggregate_limit                  big integer                       3900M
<strong id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001839188281_b1865917312504">pga_aggregate_target             big integer                   1589M</strong></pre>
</li><li>执行以下命令查看空闲内存大小。<p><strong>free -h</strong></p>
<p>回显类似如下，查看空闲内存大小。</p>
<pre class="screen">[root@localhost <font style="font-size:8pt" Face="Courier New" >~</font>]# free -h
              total        used        free      shared  buff/cache   <strong>available</strong>
<strong>Mem</strong>:            15G        2.2G        992M        4.8G         12G        <strong>8.1G</strong>
Swap:           99G          0B         99G</pre>
<p>如果空闲内存的大小不大于数据库<span class="uicontrol" id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001839188281_uicontrol116596335018">“sga_target”</span>与<span class="uicontrol" id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001839188281_uicontrol16607311501">“pga_aggregate_target”</span>值的总和，请清理内存空间，使得空闲内存的大小大于数据库<span class="uicontrol" id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001839188281_uicontrol126601137507">“sga_target”</span>与<span class="uicontrol" id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001839188281_uicontrol86609310504">“pga_aggregate_target”</span>值的总和。</p>
</li></ol>
</li></ol>
</div>
</p></li><li><span>当操作系统为Linux且恢复的目标主机为HACS（High Availability Cluster Server）集群中的主机时，恢复前请先冻结HACS集群。</span><p><div class="p" id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001839188281_p73081226165516">可参考<a href="zh-cn_topic_0000001792389224.html">如何检查恢复的目标主机是否为HACS集群中的主机</a>确认目标主机是否为HACS集群中的主机。<ol type="a" id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001839188281_ol0422132585512"><li id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001839188281_li34221251555">使用PuTTY，以<strong id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001839188281_b154227254554">root</strong>账号登录Oracle数据库主机。</li><li id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001839188281_li154221525195516">执行以下命令冻结HACS集群。<p id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001839188281_p2088691273211"><a name="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001839188281_li154221525195516"></a><a name="zh-cn_topic_0000001839188281_li154221525195516"></a><strong id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001839188281_b1283231763217">crm configure property maintenance-mode=true</strong></p>
<div class="notice" id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001839188281_note13422142510556"><span class="noticetitle"><img src="public_sys-resources/notice_3.0-zh-cn.png"> </span><div class="noticebody"><p id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001839188281_p3422122575514">恢复任务完成后，执行<strong id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001839188281_b134221125175518">crm configure property maintenance-mode=false</strong>命令解除冻结。</p>
</div></div>
</li></ol>
</div>
</p></li><li><span>选择<span class="uicontrol" id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001839188281_zh-cn_topic_0000001839142377_uicontrol1186171611461">“<span id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001839188281_zh-cn_topic_0000001839142377_text6186101615464">数据利用</span> &gt; <span id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001839188281_zh-cn_topic_0000001839142377_text74373665812">副本数据</span> &gt; <span id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001839188281_zh-cn_topic_0000001839142377_text12413710445">数据库</span> &gt; <span id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001839188281_zh-cn_topic_0000001839142377_text151861216124615">Oracle</span>”</span>。</span></li><li><span>您可以以数据库资源维度或以副本维度查找副本，本节以资源维度为例进行说明。</span><p><p>在<span class="wintitle">“<span>资源</span>”</span>页签，根据数据库名称查找到需要进行即时恢复的数据库，并单击数据库名称。</p>
</p></li><li><span>指定副本或时间点进行即时恢复。</span><p><p>您可以指定某个副本或两个副本之间的任意时间点进行即时恢复。</p>
<div class="p">如果需要指定SCN进行即时恢复，请忽略该步骤，执行<a href="#ZH-CN_TOPIC_0000001792389268__li02165214225">7</a>。<ol type="a"><li>在“<span>时间选择</span>”页签依次选择年、月、天查找副本。<p>当时间上显示<span><img src="zh-cn_image_0000001839268409.png"></span>，即表示该月、该天存在副本。</p>
</li><li>指定某个副本或两副本之间的任意时间点进行即时恢复。<ul><li>指定某个副本进行即时恢复<p><span><img class="eddx" src="zh-cn_image_0000001792389360.png"></span></p>
<p></p>
</li><li>指定两个副本之间的任意时间点进行即时恢复。<p>时间轴上<span><img src="zh-cn_image_0000001886152413.png"></span>表示该时间点存在副本。</p>
<p><span><img class="eddx" src="zh-cn_image_0000001839188445.png"></span></p>
<p></p>
<div class="note"><img src="public_sys-resources/note_3.0-zh-cn.png"><span class="notetitle"> </span><div class="notebody"><ul id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001839188281_ul75802612312"><li id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001839188281_li1497342618234">对于1.5.0版本，时间轴上最多仅展示100个副本，单击<span><img id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001839188281_image173544102299" src="zh-cn_image_0000001886153709.png"></span>可以查看所有副本。</li><li id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001839188281_li95818264231">执行时间点恢复时，由于管理界面无法获取恢复时所使用的副本信息，因此，在恢复任务和相关的事件页面，用户无法看到该恢复任务的副本信息。</li></ul>
</div></div>
</li></ul>
</li><li id="ZH-CN_TOPIC_0000001792389268__li10621031104911"><a name="ZH-CN_TOPIC_0000001792389268__li10621031104911"></a><a name="li10621031104911"></a>即时恢复Oracle数据库到原位置或新位置。<div class="p"><a name="ZH-CN_TOPIC_0000001792389268__li10621031104911"></a><a name="li10621031104911"></a><ul><li>即时恢复Oracle数据库到原位置。<ol class="substepthirdol"><li>选择即时恢复至<span class="uicontrol">“<span>原位置</span>”</span>。<div class="note"><img src="public_sys-resources/note_3.0-zh-cn.png"><span class="notetitle"> </span><div class="notebody"><p>目标路径所在磁盘的剩余空间要大于源数据库所占空间，否则恢复任务将失败。</p>
</div></div>
</li><li>配置即时恢复高级参数。<p>相关参数如<a href="#ZH-CN_TOPIC_0000001792389268__table38941874260">表1</a>所示。</p>

<div class="tablenoborder"><a name="ZH-CN_TOPIC_0000001792389268__table38941874260"></a><a name="table38941874260"></a><table cellpadding="4" cellspacing="0" summary="" id="ZH-CN_TOPIC_0000001792389268__table38941874260" frame="border" border="1" rules="all"><caption><b>表1 </b>即时恢复任务高级参数说明</caption><colgroup><col style="width:32.800000000000004%"><col style="width:67.2%"></colgroup><thead align="left"><tr><th align="left" class="cellrowborder" valign="top" width="32.800000000000004%" id="mcps1.3.4.2.6.2.2.2.3.1.1.1.1.2.2.2.3.1.1"><p>参数</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="67.2%" id="mcps1.3.4.2.6.2.2.2.3.1.1.1.1.2.2.2.3.1.2"><p>说明</p>
</th>
</tr>
</thead>
<tbody><tr><td class="cellrowborder" valign="top" width="32.800000000000004%" headers="mcps1.3.4.2.6.2.2.2.3.1.1.1.1.2.2.2.3.1.1 "><p><span>BCT功能</span></p>
</td>
<td class="cellrowborder" valign="top" width="67.2%" headers="mcps1.3.4.2.6.2.2.2.3.1.1.1.1.2.2.2.3.1.2 "><ul><li id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001839188281_li1406173315719">如果选择开启BCT功能，恢复成功后会自动开启BCT功能。</li><li id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001839188281_li1140663317578">如果选择关闭BCT功能，恢复成功后会自动关闭BCT功能。</li></ul>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="32.800000000000004%" headers="mcps1.3.4.2.6.2.2.2.3.1.1.1.1.2.2.2.3.1.1 "><p><span>通道数</span></p>
</td>
<td class="cellrowborder" valign="top" width="67.2%" headers="mcps1.3.4.2.6.2.2.2.3.1.1.1.1.2.2.2.3.1.2 "><p>控制恢复任务的并行度，通过该参数指定RMAN与数据库实例之间的最大连接数。如果主机性能一般，建议保持默认值；如果主机性能良好，可以适量增大通道数，提高并发度，提升恢复效率，建议通道数与数据文件的数量保持一致。</p>
<p>取值范围：1~254，未配置时即时恢复通道默认为8。</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="32.800000000000004%" headers="mcps1.3.4.2.6.2.2.2.3.1.1.1.1.2.2.2.3.1.1 "><p><span>执行脚本</span></p>
</td>
<td class="cellrowborder" valign="top" width="67.2%" headers="mcps1.3.4.2.6.2.2.2.3.1.1.1.1.2.2.2.3.1.2 "><p>您可以根据实际需求，在恢复任务执行前、执行成功后、执行失败后，执行自定义脚本。</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="32.800000000000004%" headers="mcps1.3.4.2.6.2.2.2.3.1.1.1.1.2.2.2.3.1.1 "><p><span>恢复前执行脚本</span></p>
</td>
<td class="cellrowborder" rowspan="3" valign="top" width="67.2%" headers="mcps1.3.4.2.6.2.2.2.3.1.1.1.1.2.2.2.3.1.2 "><p id="ZH-CN_TOPIC_0000001792389268__p2414113125419"><span>请输入脚本名称，脚本名称以</span><strong id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001656441509_b1732018117386">.sh</strong><span>结尾。确保脚本已存放在数据库主机安装目录下的</span><span class="filepath" id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001656441509_filepath560914216351">“DataBackup/ProtectClient/ProtectClient-E/sbin/thirdparty”</span><span>目录中，且登录数据库主机的用户（默认为</span><strong id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001656441509_b95043281423">root</strong><span>）对该脚本有可执行权限。如果无执行权限请依次执行以下命令授权：</span></p>
<p><strong>chown root:root</strong> <em>脚本名称</em></p>
<p><strong>chmod 500</strong><strong> </strong><em>脚本名称</em></p>
<div class="note"><span class="notetitle"> 说明： </span><div class="notebody"><p id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001839188281_p519614617243">当配置了<span class="uicontrol" id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001839188281_uicontrol12195646192416">“<span id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001839188281_text1119584613243">恢复成功执行脚本</span>”</span>时，即使该脚本执行失败，管理界面上也会显示恢复任务的状态为<span class="uicontrol" id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001839188281_uicontrol4196154615243">“<span id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001839188281_text17195104615249">成功</span>”</span>。请您留意任务详情中是否有后置脚本执行失败的相关提示，如有请及时修正脚本。</p>
</div></div>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" headers="mcps1.3.4.2.6.2.2.2.3.1.1.1.1.2.2.2.3.1.1 "><p><span>恢复成功执行脚本</span></p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" headers="mcps1.3.4.2.6.2.2.2.3.1.1.1.1.2.2.2.3.1.1 "><p><span>恢复失败执行脚本</span></p>
</td>
</tr>
</tbody>
</table>
</div>
</li><li>单击<span class="uicontrol">“<span>确定</span>”</span>。</li></ol>
</li><li>即时恢复Oracle数据库至新位置。<ol class="substepthirdol"><li>选择即时恢复至<span class="uicontrol">“<span>新位置</span>”</span>。</li><li>配置即时恢复基本参数及高级参数。<p>相关参数说明如<a href="#ZH-CN_TOPIC_0000001792389268__table689710718267">表2</a>所示。</p>

<div class="tablenoborder"><a name="ZH-CN_TOPIC_0000001792389268__table689710718267"></a><a name="table689710718267"></a><table cellpadding="4" cellspacing="0" summary="" id="ZH-CN_TOPIC_0000001792389268__table689710718267" frame="border" border="1" rules="all"><caption><b>表2 </b>即时恢复参数说明</caption><colgroup><col style="width:18.41%"><col style="width:81.58999999999999%"></colgroup><thead align="left"><tr><th align="left" class="cellrowborder" valign="top" width="18.41%" id="mcps1.3.4.2.6.2.2.2.3.1.1.2.1.2.2.2.3.1.1"><p>参数</p>
</th>
<th align="left" class="cellrowborder" valign="top" width="81.58999999999999%" id="mcps1.3.4.2.6.2.2.2.3.1.1.2.1.2.2.2.3.1.2"><p>说明</p>
</th>
</tr>
</thead>
<tbody><tr><td class="cellrowborder" valign="top" width="18.41%" headers="mcps1.3.4.2.6.2.2.2.3.1.1.2.1.2.2.2.3.1.1 "><p><span>目标主机/集群</span></p>
</td>
<td class="cellrowborder" valign="top" width="81.58999999999999%" headers="mcps1.3.4.2.6.2.2.2.3.1.1.2.1.2.2.2.3.1.2 "><p>即时恢复到的目标主机或集群。</p>
<div class="note"><span class="notetitle"> 说明： </span><div class="notebody"><p id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001839188281_p2922101773417">如果恢复到集群，请选择恢复到该集群下的一个节点。</p>
</div></div>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="18.41%" headers="mcps1.3.4.2.6.2.2.2.3.1.1.2.1.2.2.2.3.1.1 "><div class="p">原实例<div class="note" id="ZH-CN_TOPIC_0000001792389268__note15922394357"><span class="notetitle"> 说明： </span><div class="notebody"><p id="ZH-CN_TOPIC_0000001792389268__p292039103511">仅1.6.0及后续版本存在此参数。</p>
</div></div>
</div>
</td>
<td class="cellrowborder" valign="top" width="81.58999999999999%" headers="mcps1.3.4.2.6.2.2.2.3.1.1.2.1.2.2.2.3.1.2 "><p>选择恢复到目标位置的原实例。</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="18.41%" headers="mcps1.3.4.2.6.2.2.2.3.1.1.2.1.2.2.2.3.1.1 "><div class="p">目标实例<div class="note"><span class="notetitle"> 说明： </span><div class="notebody"><p id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001792389268_p292039103511">仅1.6.0及后续版本存在此参数。</p>
</div></div>
</div>
</td>
<td class="cellrowborder" valign="top" width="81.58999999999999%" headers="mcps1.3.4.2.6.2.2.2.3.1.1.2.1.2.2.2.3.1.2 "><div class="p">支持配置恢复到目标位置的实例名，如不配置，则与恢复前的原实例名保持一致。<div class="note" id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001839188281_note16724735153418"><span class="notetitle"> 说明： </span><div class="notebody"><p id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001839188281_p17724173583412">如果配置了目标实例名，恢复后请使用目标实例名登录数据库。</p>
</div></div>
</div>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="18.41%" headers="mcps1.3.4.2.6.2.2.2.3.1.1.2.1.2.2.2.3.1.1 "><p><span>目标路径</span></p>
</td>
<td class="cellrowborder" valign="top" width="81.58999999999999%" headers="mcps1.3.4.2.6.2.2.2.3.1.1.2.1.2.2.2.3.1.2 "><p><span style="color:#282B33;">目标主机上待即时恢复的数据库所在的ASM磁盘组目录或者文件系统目录。</span>即时恢复后的数据库名称与源数据库名称相同。</p>
<p><span style="color:#282B33;">ASM磁盘组目录举例：+ORADATA，文件系统目录举例：/u01/oracle/oradata/。</span></p>
<div class="note"><span class="notetitle"> 说明： </span><div class="notebody"><ul><li>如果目标路径为空，请提前在目标主机上准备与生产数据库相同的ASM磁盘组目录或文件系统目录。</li><li>目标路径所在磁盘的剩余空间要大于源数据库所占空间，否则恢复任务将失败。</li></ul>
</div></div>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="18.41%" headers="mcps1.3.4.2.6.2.2.2.3.1.1.2.1.2.2.2.3.1.1 "><p><span>BCT功能</span></p>
</td>
<td class="cellrowborder" valign="top" width="81.58999999999999%" headers="mcps1.3.4.2.6.2.2.2.3.1.1.2.1.2.2.2.3.1.2 "><ul><li id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001839188281_li1406173315719_1">如果选择开启BCT功能，恢复成功后会自动开启BCT功能。</li><li id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001839188281_li1140663317578_1">如果选择关闭BCT功能，恢复成功后会自动关闭BCT功能。</li></ul>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="18.41%" headers="mcps1.3.4.2.6.2.2.2.3.1.1.2.1.2.2.2.3.1.1 "><p><span>通道数</span></p>
</td>
<td class="cellrowborder" valign="top" width="81.58999999999999%" headers="mcps1.3.4.2.6.2.2.2.3.1.1.2.1.2.2.2.3.1.2 "><p>控制恢复任务的并行度，通过该参数指定RMAN与数据库实例之间的最大连接数。如果主机性能一般，建议保持默认值；如果主机性能良好，可以适量增大通道数，提高并发度，提升恢复效率，建议通道数与数据文件的数量保持一致。</p>
<p>取值范围：1~254，未配置时即时恢复通道默认为8。</p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="18.41%" headers="mcps1.3.4.2.6.2.2.2.3.1.1.2.1.2.2.2.3.1.1 "><p><span>恢复前执行脚本</span></p>
</td>
<td class="cellrowborder" rowspan="3" valign="top" width="81.58999999999999%" headers="mcps1.3.4.2.6.2.2.2.3.1.1.2.1.2.2.2.3.1.2 "><p>您可以根据实际需求，在即时恢复任务执行前、执行成功后、执行失败后，执行自定义脚本。</p>
<p><span>请输入脚本名称，脚本名称以</span><strong id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001792389268_zh-cn_topic_0000001656441509_b1732018117386">.sh</strong><span>结尾。确保脚本已存放在数据库主机安装目录下的</span><span class="filepath" id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001792389268_zh-cn_topic_0000001656441509_filepath560914216351">“DataBackup/ProtectClient/ProtectClient-E/sbin/thirdparty”</span><span>目录中，且登录数据库主机的用户（默认为</span><strong id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001792389268_zh-cn_topic_0000001656441509_b95043281423">root</strong><span>）对该脚本有可执行权限。如果无执行权限请依次执行以下命令授权：</span></p>
<p><strong>chown root:root</strong> <em>脚本名称</em></p>
<p><strong>chmod 500</strong><strong> </strong><em>脚本名称</em></p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" headers="mcps1.3.4.2.6.2.2.2.3.1.1.2.1.2.2.2.3.1.1 "><p><span>恢复成功执行脚本</span></p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" headers="mcps1.3.4.2.6.2.2.2.3.1.1.2.1.2.2.2.3.1.1 "><p><span>恢复失败执行脚本</span></p>
</td>
</tr>
<tr><td class="cellrowborder" valign="top" width="18.41%" headers="mcps1.3.4.2.6.2.2.2.3.1.1.2.1.2.2.2.3.1.1 "><p><span>修改数据库配置</span></p>
</td>
<td class="cellrowborder" valign="top" width="81.58999999999999%" headers="mcps1.3.4.2.6.2.2.2.3.1.1.2.1.2.2.2.3.1.2 "><p>根据目标主机的实际配置修改数据库参数，参数错误将导致恢复数据库失败。</p>
<div class="note"><span class="notetitle"> 说明： </span><div class="notebody"><p>恢复时，要求目标主机的空闲内存大小必须大于数据库SGA和PGA的大小总和，否则可能导致恢复失败。</p>
<ol><li>查看目标主机空闲内存的大小。<p>具体操作可参考<a href="#ZH-CN_TOPIC_0000001792389268__li17844445165619">2</a>。</p>
</li><li>开启<span class="uicontrol">“<span>修改数据库配置</span>”</span>开关后，搜索<span class="uicontrol" style="color:#282B33;">“*.pga_aggregate_target”</span>和<span class="uicontrol" style="color:#282B33;">“*.sga_target”</span>参数。<p>检查空闲内存大小是否大于<span class="uicontrol" style="color:#282B33;">“*.pga_aggregate_target”</span><span style="color:#282B33;">与</span><span class="uicontrol" style="color:#282B33;">“*.sga_target”</span>的总和。</p>
<ul><li>是，结束处理。</li><li>否，执行<a href="#ZH-CN_TOPIC_0000001792389268__li1089719792612">3</a>。</li></ul>
</li><li id="ZH-CN_TOPIC_0000001792389268__li1089719792612"><a name="ZH-CN_TOPIC_0000001792389268__li1089719792612"></a><a name="li1089719792612"></a>修改<span class="uicontrol" style="color:#282B33;">“*.pga_aggregate_target”</span><span style="color:#282B33;">或</span><span class="uicontrol" style="color:#282B33;">“*.sga_target”</span>其中一个参数或两个参数都修改，使得空闲内存大小大于<span class="uicontrol" style="color:#282B33;">“*.pga_aggregate_target”</span><span style="color:#282B33;">与</span><span class="uicontrol" style="color:#282B33;">“*.sga_target”</span>的总和<strong>。</strong><p>如果搜索到多个相同的参数，相同的参数均需修改。</p>
</li><li>如果修改了<span class="uicontrol" style="color:#282B33;">“*.pga_aggregate_target”</span>，需要同步修改<span style="color:#282B33;">“</span><em style="color:#282B33;">实例名称</em><span style="color:#282B33;">.__pga_aggregate_target</span>”的值，修改<span style="color:#282B33;">“</span><em style="color:#282B33;">实例名称</em><span style="color:#282B33;">.__pga_aggregate_target”为</span>：<p><em style="color:#282B33;">实例名称</em><strong style="color:#282B33;">.__pga_aggregate_target = *.pga_aggregate_target * 1024 *1024</strong></p>
<p>如果修改了<span class="uicontrol" style="color:#282B33;">“*.sga_target”</span><span style="color:#282B33;">，需要同步修改</span><span style="color:#282B33;">“</span><em style="color:#282B33;">实例名称</em>.__sga_target”的值，计算<span style="color:#282B33;">“</span><em style="color:#282B33;">实例名称</em>.__sga_target”：</p>
<p><em style="color:#282B33;">实例名称</em><strong style="color:#282B33;">.__sga_target = *.sga_target</strong><strong> * 1024 *1024</strong></p>
</li></ol>
</div></div>
</td>
</tr>
</tbody>
</table>
</div>
</li><li>单击<span class="uicontrol">“<span>确定</span>”</span>。<div class="note"><img src="public_sys-resources/note_3.0-zh-cn.png"><span class="notetitle"> </span><div class="notebody"><p id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001839188281_p63168441018">对于1.6.0及后续版本，如果恢复的目标数据库名称与原数据库名称相同，恢复任务完成后，请对恢复目标资源执行资源扫描操作，以确保获取的实例名称信息正确。</p>
</div></div>
</li></ol>
</li></ul>
</div>
</li></ol>
</div>
</p></li><li id="ZH-CN_TOPIC_0000001792389268__li02165214225"><a name="ZH-CN_TOPIC_0000001792389268__li02165214225"></a><a name="li02165214225"></a><span>指定SCN号进行即时恢复。</span><p><ol type="a"><li>在<span class="wintitle">“<span>SCN</span>”</span>页签，输入SCN号，单击<span class="uicontrol">“<span>更多</span> &gt; <span>即时恢复</span>”</span>。<div class="note"><img src="public_sys-resources/note_3.0-zh-cn.png"><span class="notetitle"> </span><div class="notebody"><p>执行以下命令获取数据库当前SCN。</p>
<p><strong>select dbms_flashback.get_system_change_number from dual;</strong></p>
</div></div>
</li><li>选择备份副本进行恢复。<p id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001839188281_p1641915411820">界面上展示的是包含当前SCN的所有备份副本。您可以根据备份副本时间判断恢复到的SCN。</p>
<p id="ZH-CN_TOPIC_0000001792389268__zh-cn_topic_0000001839188281_p184191549183">如果没有任何副本显示，则说明要恢复的SCN点没有备份的日志，无法进行SCN恢复，请重新输入其他SCN。</p>
</li><li>即时恢复数据库至原位置或新位置。<p>具体配置请参考<a href="#ZH-CN_TOPIC_0000001792389268__li10621031104911">6.c</a>。</p>
</li></ol>
</p></li></ol>
</div>
</div>
<div>
<div class="familylinks">
<div class="parentlink"><strong>父主题：</strong> <a href="zh-cn_topic_0000001792389316.html">即时恢复</a></div>
</div>
</div>

<div class="hrcopyright"><hr size="2"></div><div class="hwcopyright">版权所有 &copy; 华为技术有限公司</div></body>
</html>